/**
 * 解析当前菜单对应的路由
 * @param path1
 * @param path2
 */
export const resolve = (path1 = '', path2 = '') => {
  let separator = '/';
  if (path1.endsWith('/') || path2.startsWith('/')) {
    separator = '';
  }
  return `${path1}${separator}${path2}`;
};

export const generatePath = (path: string) => {
  const pathname = window.location.pathname;
  if (pathname.startsWith('/platform')) return '/platform' + path;
  if (pathname.startsWith('/client')) return '/client' + path;
  return path;
}

export const getEndian = () => {
  const pathname = window.location.pathname;
  let endian = '';
  if (pathname.startsWith('/platform')) endian = '平台';
  if (pathname.startsWith('/client')) endian = '用户';
  return endian;
}
